﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DCTLib.Common;
using System.Data;

namespace Library.DCTAccess.Business.Report
{
    public class Report
    {
        private int _month = 0;
        private decimal _total = 0;

        public int Month
        {
            get { return _month; }
            set { _month = value; }
        }       

        public decimal Total
        {
            get { return _total; }
            set { _total = value; }
        }

        public Report() { }

        public Report(int iMonth, decimal iTotal)
        {
            this.Month = iMonth;
            this.Total = iTotal;
        }

        public static DataTable GetReportByFilter(int reValue)
        {
            SQLHelper sqlHelper = new SQLHelper();
            string sProc = "Report_spr";
            sqlHelper.AddParameter("@Year", reValue);
            DataTable dtReport = sqlHelper.GetDataTable(sProc);
            if (ValidationHelper.HasRow(dtReport))
            {
                return dtReport;
            }
            else
            {
                return null;
            }            
        }       
    }
}
